﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Default.Master" AutoEventWireup="true" CodeBehind="NewEvent.aspx.cs" Inherits="App.NewEvent" Theme="Alpha" %>


<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h1>Vytvoření nové akce</h1>
    <asp:Panel ID="Panel2" runat="server" Visible="false">
        <asp:Label ID="lblInfo" runat="server" CssClass="formMessage"></asp:Label>
    </asp:Panel>
    <asp:Panel ID="Panel1" runat="server">
        <asp:Panel ID="Panel5" runat="server">
            <asp:Panel ID="Panel3" runat="server">
            <div class="formField">
                <asp:Label ID="Label1" runat="server" Text="Název akce: "></asp:Label>
                <asp:TextBox ID="txtboxEventName" runat="server" 
                    ValidationGroup="EventValidation" MaxLength="50"></asp:TextBox>
            </div>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtboxEventName" ErrorMessage="Název akce musí být zadán"  ValidationGroup="EventValidation"></asp:RequiredFieldValidator>
            <div class="formField">
                <asp:Label ID="Label2" runat="server" Text="Datum konání: "></asp:Label>
                <asp:TextBox ID="txtboxEventDate" runat="server" 
                    ToolTip="Datum ve formátu: DEN.MĚSÍC.ROK" ValidationGroup="EventValidation" 
                    MaxLength="50"></asp:TextBox>
                <asp:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtboxEventDate" Format="dd.MM.yyyy" TodaysDateFormat="d, MMMM, yyyy"></asp:CalendarExtender>
            </div>
            <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="txtboxEventDate" ErrorMessage="Špatný formát data" Operator="DataTypeCheck" Type="Date" ValidationGroup="EventValidation"></asp:CompareValidator>
            <div class="formSelect">
                <asp:Label ID="Label10" runat="server" Text="Čas konání: "></asp:Label>
                <asp:DropDownList ID="DropDownList1" runat="server" CssClass="small">
                    <asp:ListItem>00</asp:ListItem>
                    <asp:ListItem>01</asp:ListItem>
                    <asp:ListItem>02</asp:ListItem>
                    <asp:ListItem>03</asp:ListItem>
                    <asp:ListItem>04</asp:ListItem>
                    <asp:ListItem>05</asp:ListItem>
                    <asp:ListItem>06</asp:ListItem>
                    <asp:ListItem>07</asp:ListItem>
                    <asp:ListItem>08</asp:ListItem>
                    <asp:ListItem>09</asp:ListItem>
                    <asp:ListItem Selected="True">10</asp:ListItem>
                    <asp:ListItem>11</asp:ListItem>
                    <asp:ListItem>12</asp:ListItem>
                    <asp:ListItem>13</asp:ListItem>
                    <asp:ListItem>14</asp:ListItem>
                    <asp:ListItem>15</asp:ListItem>
                    <asp:ListItem>16</asp:ListItem>
                    <asp:ListItem>17</asp:ListItem>
                    <asp:ListItem>18</asp:ListItem>
                    <asp:ListItem>19</asp:ListItem>
                    <asp:ListItem>20</asp:ListItem>
                    <asp:ListItem>21</asp:ListItem>
                    <asp:ListItem>22</asp:ListItem>
                    <asp:ListItem>23</asp:ListItem>
                </asp:DropDownList>
                <asp:DropDownList ID="DropDownList2" runat="server" CssClass="small">
                    <asp:ListItem>00</asp:ListItem>
                    <asp:ListItem>05</asp:ListItem>
                    <asp:ListItem>10</asp:ListItem>
                    <asp:ListItem>15</asp:ListItem>
                    <asp:ListItem>20</asp:ListItem>
                    <asp:ListItem>25</asp:ListItem>
                    <asp:ListItem>30</asp:ListItem>
                    <asp:ListItem>35</asp:ListItem>
                    <asp:ListItem>40</asp:ListItem>
                    <asp:ListItem>45</asp:ListItem>
                    <asp:ListItem>50</asp:ListItem>
                    <asp:ListItem>55</asp:ListItem>
                </asp:DropDownList>
            </div>
            <div class="formField">
                <asp:Label ID="Label4" runat="server" Text="Místo konání: "></asp:Label>
                <asp:TextBox ID="txtboxAddress" runat="server" MaxLength="50"></asp:TextBox>
            </div>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtboxAddress" ErrorMessage="Místo konání musí být zadáno" ValidationGroup="EventValidation"></asp:RequiredFieldValidator>
            <div class="formField">
                <asp:Label ID="Label5" runat="server" Text="Cena v Kč: "></asp:Label>
                <asp:TextBox ID="txtboxPrice" runat="server" MaxLength="9"></asp:TextBox>
                    <ajaxToolkit:FilteredTextBoxExtender ID="FtxtBoxEx1" runat="server" FilterType="Custom"
                        TargetControlID="txtboxPrice" ValidChars="0123456789"></ajaxToolkit:FilteredTextBoxExtender>
            </div>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtboxPrice" ErrorMessage="Cena musí být zadána" ValidationGroup="EventValidation"></asp:RequiredFieldValidator>
            <div class="formField">
                <asp:Label ID="Label6" runat="server" Text="Počet účastníků: "></asp:Label>
                <asp:TextBox ID="txtboxSeats" runat="server" MaxLength="9" Enabled="false"></asp:TextBox>
                <ajaxToolkit:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" TargetControlID="txtboxSeats" FilterType="Custom" ValidChars="0123456789"></ajaxToolkit:FilteredTextBoxExtender>
            </div>
            <asp:CompareValidator ID="CompareValidator5" runat= "server" ControlToValidate="txtboxSeats" 
            ValidationGroup="EventValidation" ErrorMessage="Minimální počet účástníků musí být 1" 
                    Operator="GreaterThan" ValueToCompare="0"></asp:CompareValidator>
             <div class="formCheckbox">
                <asp:Label ID="Label12" runat="server" Text="Přihlásit členy: "></asp:Label>
                <asp:CheckBox ID="CheckBoxAllTeam" runat="server" 
                    Text="" Checked="true" 
                    oncheckedchanged="CheckBoxAllTeam_CheckedChanged" AutoPostBack="True"/>
            </div>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtboxSeats" ErrorMessage="Musí být zadán počet účastníků" ValidationGroup="EventValidation"></asp:RequiredFieldValidator>
            <div class="formSelect">
                <asp:Label ID="Label11" runat="server" Text="Akce je pro tým: "></asp:Label>
                <asp:DropDownList ID="DropDownListTeamEvent" runat="server" 
                    onselectedindexchanged="DropDownListTeamEvent_SelectedIndexChanged" AutoPostBack="True"  ></asp:DropDownList>
            </div>
            <div class="formTextarea">
                <asp:Label ID="Label3" runat="server" Text="Popis akce: "></asp:Label>
                <asp:TextBox ID="txtboxDescription" runat="server" TextMode="MultiLine" MaxLength="100"></asp:TextBox>
            </div>
            <div class="formCheckbox">
                <asp:Label ID="Label9" runat="server" Text="Pravidelná akce: "></asp:Label>
                <asp:CheckBox ID="chckRepeatable" runat="server" Text="" oncheckedchanged="CheckBox1_CheckedChanged" AutoPostBack="True" />
            </div>
            <asp:Panel ID="Panel4" runat="server" Visible="False">
                <div class="formSelect">
                    <asp:Label ID="Label7" runat="server" Text="Opakovat: "></asp:Label>
                    <asp:ListBox ID="ListBox1" runat="server" Rows="1">
                        <asp:ListItem Value="1">Každý den</asp:ListItem>
                        <asp:ListItem Value="7">Každý týden</asp:ListItem>
                        <asp:ListItem Value="14">Každý druhý týden</asp:ListItem>
                        <asp:ListItem Value="21">Každý třetí týden</asp:ListItem>
                        <asp:ListItem Value="28">Každý měsíc</asp:ListItem>
                    </asp:ListBox>
                </div>
            </asp:Panel>
                <asp:RegularExpressionValidator ID="regComments" runat="server" 
                    ControlToValidate="txtboxDescription" 
                    ErrorMessage="Popis akce může obsahovat pouze 100 znaků" 
                    ValidationExpression="^[\s\S]{0,100}$" ValidationGroup="EventValidation"></asp:RegularExpressionValidator>
            <div class="formField">
                <asp:Label ID="Label8" runat="server" Text="Opakovat do: " Visible="False"></asp:Label>
                <asp:TextBox ID="txtboxFinalDate" runat="server" 
                    ToolTip="Datum ve formátu: DEN.MĚSÍC.ROK" ValidationGroup="EventValidation" 
                    Visible="False" MaxLength="50"></asp:TextBox>
                <asp:CalendarExtender ID="txtboxFinalDate_CalendarExtender" runat="server" Format="dd.MM.yyyy" TargetControlID="txtboxFinalDate"></asp:CalendarExtender>
            </div>
            <asp:CompareValidator ID="CompareValidator2" runat="server" 
                    ControlToValidate="txtboxFinalDate" ErrorMessage="Špatný formát data" 
                    Operator="DataTypeCheck" Type="Date" ValidationGroup="EventValidation" 
                    Enabled="False"></asp:CompareValidator>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                    ControlToValidate="txtboxFinalDate" ErrorMessage="Zadejte datum" 
                    ValidationGroup="EventValidation" Enabled="False"></asp:RequiredFieldValidator>
            <div class="formButton">
                <asp:Button ID="Button1" runat="server" Height="23px" onclick="Button1_Click" Text="Vytvořit akci" ValidationGroup="EventValidation" />
            </div>

             </asp:Panel>
         </asp:Panel>
    </asp:Panel>
</asp:Content>
